package com.cxd.service.impl;

import com.cxd.entity.EbOrder;
import com.cxd.mapper.EbOrderMapper;
import com.cxd.service.IEbOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EbOrderServiceImpl implements IEbOrderService {
    @Autowired
    private EbOrderMapper orderMapper;
    @Override
    public List<EbOrder> listByPage(Integer page, Integer pageSize) {
        Integer from = (page - 1)*pageSize;
        return orderMapper.findByPage(from,pageSize);
    }


    @Override
    public EbOrder selectByCondition(Integer eoId) {
        return null;
    }
    @Override
    public int updateById(EbOrder ebOrder) {
        return 0;
    }
    @Override
    public int delete(Integer eoId) {
        return 0;
    }

    @Override
    public Integer findTotalPage(Integer pageSize) {
        return orderMapper.getTotalPage(pageSize);
    }

    @Override
    public List<EbOrder> findByUid(String eoUserId) {
        return orderMapper.findByUid(eoUserId);
    }

    @Override
    public EbOrder selectOne(Integer eoId){
        return orderMapper.selectOne(eoId);
    }


    @Override
    public Integer updateOrder(EbOrder ebOrder){
        return orderMapper.updateByPrimaryKey(ebOrder);
    }

    @Override
    public int deleteByPk(int id) {
        return orderMapper.delete(id);
    }

    @Override
    public Integer save(EbOrder ebOder) {
        return orderMapper.save(ebOder);
    }


}
